<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <title>Forgot password - Tabler - Premium and Open Source dashboard template with responsive and high quality
        UI.</title>
    <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
    <meta name="msapplication-TileColor" content="#206bc4"/>
    <meta name="theme-color" content="#206bc4"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="mobile-web-app-capable" content="yes"/>
    <meta name="HandheldFriendly" content="True"/>
    <meta name="MobileOptimized" content="320"/>
    <meta name="robots" content="noindex,nofollow,noarchive"/>
    <link rel="icon" href="./favicon.ico" type="image/x-icon"/>
    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon"/>
    <!-- CSS files -->
    <link href="/dist/css/tabler.min.css" rel="stylesheet"/>
    <link href="/dist/css/demo.min.css" rel="stylesheet"/>
    <style>
        body {
            display: none;
        }
    </style>
</head>
<body class="antialiased border-top-wide border-primary d-flex flex-column">
<div class="flex-fill d-flex flex-column justify-content-center">
    <div class="container-tight py-6">
        <div class="text-center mb-4">
            <img src="./static/logo.svg" height="36" alt="">
        </div>
        <form class="card card-md" action="." method="get">
            <div class="card-body">
                <h2 class="mb-5 text-center">重置密码</h2>
                <p class="text-muted">输入邮箱，我们会将新密码通过邮件发送给您</p>
                <div class="mb-3">
                    <label class="form-label">邮箱</label>
                    <input type="email" class="form-control email" placeholder="请输入邮箱地址">
                </div>
                <div class="form-footer">
                    <button type="button" class="btn btn-primary btn-block sendMail">发 送</button>
                </div>
            </div>
        </form>
        <div class="text-center text-muted">
            <a href="/">去登陆</a>
        </div>
    </div>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.min.js"></script>
<!-- Libs JS -->
<script src="/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<!-- Tabler Core -->
<script src="/dist/js/tabler.min.js"></script>
<script>
    document.body.style.display = "block";
    $(".sendMail").click(function () {
        var mail = $(".email").val();
        if (mail == undefined || mail == "" || mail == null) {
            layer.msg("请输入邮箱地址!");
            return;
        }

        $.ajax({
            type: "get",
            url: "/createNewPassword?email=" + mail,
            dataType: 'json',
            success: function (res) {
                if (res.code == 0) {
                    layer.msg("新密码已发送至您的邮箱！");
                }
            }, error: function () {
                layer.msg("错误!");
            }
        });
    });
</script>
</body>
</html>
